define(['egis'], function (egis) {
    Window.deserializer = Window.deserializer || new egis.core.Deserializer();
    Window.container = Window.container || {};
    var toolTips = toolTips || [];
    dsBridge.register('create_MeasureService', function (sourceId) {
        var projectService = new egis.sfs.CoordinateTransform();
        var measureService = new egis.sfs.MeasureService({projectService: projectService});
        Window.container[sourceId] = measureService;
    })

    dsBridge.register('MeasureService_area', function (sourceId, geometry) {
        try {
            geometry = Window.deserializer.createJsInstance(JSON.parse(geometry));
            var source = Window.container[sourceId];
            return source.area(geometry);
        }
        catch (e) {
            alert(e)
        }
    })
    dsBridge.register('MeasureService_length', function (sourceId, geometry) {
        try {
            geometry = Window.deserializer.createJsInstance(JSON.parse(geometry));
            var source = Window.container[sourceId];
            return source.length(geometry);
        }
        catch (e) {
            alert(e)
        }
    })


})